home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / mblast32 / data.z / taskbar.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-09-09  |  3.0 KB  |  92 lines

  1. VERSION 4.00
  2. Begin VB.Form frmTaskbar 
  3.    Caption         =   "You shouldn't see this form."
  4.    ClientHeight    =   1530
  5.    ClientLeft      =   1560
  6.    ClientTop       =   2040
  7.    ClientWidth     =   2835
  8.    Height          =   2160
  9.    Left            =   1530
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   1530
  12.    ScaleWidth      =   2835
  13.    Top             =   1440
  14.    Width           =   2895
  15.    Begin MessageBlaster.MsgBlaster msgbMain 
  16.       Left            =   360
  17.       Top             =   240
  18.       _version        =   65536
  19.       _extentx        =   847
  20.       _extenty        =   847
  21.       _stockprops     =   0
  22.       enabled         =   -1  'True
  23.       voodoo          =   "taskbar.frx":0000
  24.    End
  25.    Begin VB.Menu mnuHolder 
  26.       Caption         =   "mnuHolder"
  27.       Begin VB.Menu mnuHolderAbout 
  28.          Caption         =   "&About..."
  29.       End
  30.       Begin VB.Menu mnuHolderSep1 
  31.          Caption         =   "-"
  32.       End
  33.       Begin VB.Menu mnuHolderClose 
  34.          Caption         =   "&Close"
  35.       End
  36.    End
  37. Attribute VB_Name = "frmTaskbar"
  38. Attribute VB_Creatable = False
  39. Attribute VB_Exposed = False
  40. Option Explicit
  41. Private Sub Form_Load()
  42.    On Error Resume Next
  43.    'set message receiving target to desired form handle
  44.    msgbMain.hWndTarget = Me.hwnd
  45.    'add application defined message to MessageBlaster "watch" list
  46.    msgbMain.AddMessage WM_USER, POSTPROCESS
  47.    'add icon to Win95 taskbar
  48.    AddIcon Me, WM_USER, "Message Blaster/Taskbar Icon Sample by Cris Williams"
  49. End Sub
  50. Private Sub mnuHolderAbout_Click()
  51.    On Error Resume Next
  52.    'show about box
  53.    frmAbout.Show vbModal
  54. End Sub
  55. Private Sub mnuHolderClose_Click()
  56.    On Error Resume Next
  57.    'remove icon from Win95 taskbar
  58.    DelIcon
  59.    'send message to designated form to shutdown
  60.    SendMessage hwnd, WM_USER, 0, WM_USER + 1
  61. End Sub
  62. Private Sub msgbMain_Message(ByVal hwnd As Long, ByVal Msg As Long, wParam As Long, lParam As Long, nPassage As Integer, lReturnValue As Long)
  63.    On Error Resume Next
  64.    'evaluate lParam argument of received message
  65.    Select Case lParam
  66.       'if left button is clicked on taskbar icon...
  67.       Case WM_LBUTTONDOWN
  68.       
  69.          'display informative message
  70.          MsgBox "The left mouse button was clicked.", vbInformation, App.Title
  71.          
  72.       'if middle or right button is clicked on taskbar icon...
  73.       Case WM_MBUTTONDOWN, WM_RBUTTONDOWN
  74.       
  75.          If IsWindowVisible(frmAbout.hwnd) Then
  76.             MsgBox "Close the About dialog, then continue.", vbExclamation, App.Title
  77.             Exit Sub
  78.          End If
  79.          'display popup menu at mousepointer
  80.          popupmenu mnuHolder, 0, , , mnuHolderClose
  81.          
  82.       'if application defined message is received
  83.       Case WM_USER + 1
  84.          
  85.          'shutdown
  86.          End
  87.          
  88.    End Select
  89. End Sub
  90. Private Sub msgbMain_Click()
  91. End Sub
  92.